using UnityEngine;

namespace Light
{
    public class AudioCom : CoreComponent
    {
        [SerializeField] private AudioSource sfx;

        protected override void Awake()
        {
            base.Awake();
            sfx = GetComponent<AudioSource>();
        }

        //������Ƶ
        public void PlaySFX(AudioClip audioClip)
        {
            sfx.clip = audioClip;
            sfx.Play();
        }

        //���������Ƶ
        public void PlayRandomSFX(AudioClip[] audioClips)
        {
            if (audioClips.Length != 0)
                PlaySFX(audioClips[Random.Range(0, audioClips.Length)]);
        }
    }
}